/****** Object:  Stored Procedure [dbo].spuserGet Script Date: 11/24/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spuserSearch]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spuserSearch]
GO

/******************************************************************************
**		Name: [dbo].spuserSearch
**		Desc:
**
**		Return values:
**
**		Called by:
**
**		Parameters:
**		Input						Output
**		----------					----------
**
**		Auth: MinhSong
**		Date: 11/24/2012
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**
*******************************************************************************/

CREATE PROCEDURE [dbo].[spuserSearch]
(
	@Username nvarchar(50),
	@Fullname nvarchar(50)
)
WITH ENCRYPTION
AS

SET NOCOUNT ON

SELECT 
	*
FROM 
	[tbl_user]
WHERE (@Username is null OR [Username] Like N'%'+@Username+'%') 
AND (@Fullname is Null OR [Fullname] Like N'%'+@Fullname+'%')
GO

